package main

import "fmt"

func reverse(str string) string {
	var result string
	for i := 0; i < len(str); i++ {
		result = result + fmt.Sprintf("%c", str[len(str)-i-1])
	}
	return result
}

func reverse1(str string) string {
	var result []byte
	tmp := []byte(str)
	for i := 0; i < len(str); i++ {
		result = append(result, tmp[len(str)-i-1])
	}
	return string(result)
}

func main() {
	str := "simon"
	fmt.Println("reverse is:", reverse(str))
	str = "simon"
	fmt.Println("reverse is:", reverse1(str))
}
